Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site nav link colors #15

Merged

Conversation

Alex-Jordan
Copy link

I thought I opened this last night, but I'm wondering if I never hit a final button or otherwise messed up.

Compared with develop, this:

  • removes the background colors for the student nav items
  • inserts an hr as you suggested
  • increases the thickness of focus outline on a link to 3px
  • to make the full outline visible on nav links, gives a 3px padding to the site nav
  • tweaks the color of the link outline for the non-yellow themes

The added padding on the site nav leaves it so that the active item is visually outlined by the overall background off white. At first I did not like that, but it grew on me as I looked at more examples while tweaking things. Also it makes this more consistent with when the active link is something nested, say like a particular exercise set.

Copy link
Owner

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks mostly okay. Except I don't like the outline width.

htdocs/themes/math4-yellow/_theme-overrides.scss Outdated Show resolved Hide resolved
htdocs/themes/math4/math4.scss Outdated Show resolved Hide resolved
Copy link
Owner

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments didn't make it into that last review. I forgot to click "add" on them.

templates/ContentGenerator/Base/links.html.ep Outdated Show resolved Hide resolved
outline-color: $link-hover-color;
outline-width: 1px;
outline-color: #{lighten($link-hover-color, 30%)};
outline-width: 3px;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we compromise on this and go with a 2 pixel outline? The 3 pixel outline seems rather bulky to me. This applies to all links on the page, and it looks particularly bad on other links in the page that aren't in the site nav.

Either that or could we make the 3 pixel outline only on the active link in the site nav? The others could have a 2 pixel outline perhaps.

Also, isn't the outline color to light now? This only has a contrast ratio of 1.77:1 against a white (#ffffff) background and a ratio of 1.68:1 against the site nav background. Doesn't it need a ratio of 3:1?

@Alex-Jordan
Copy link
Author

I can make changes like these and double check on the contrast. I thought it was good, but Firefox is not letting me sample outline colors and since some are not explicit (eg lighten by 10%) I may have used the wrong color codes.

I want to double check on something. This is just for focus on links. In "regular" use (not keyboard navigation), you see the outline for a moment when you click a link and not at other times. If you are keyboard tabbing, you will see the outline and it lingers. So for the keyboard navigator, that intensity could be helpful, and for the non-keyboard navigator it's only visible for a flash. I just want to check that in light of that, you still feel it's too thick.

@drgrice1
Copy link
Owner

drgrice1 commented Aug 7, 2023

I can live with it I suppose if you really think that 2 pixels is not enough. I use keyboard navigation frequently, and so it is prevalent for me. In addition, there are numerous instance where focus persists on a link after a mouse click. For example, if you click on one of the instructor help links as in this screen shot:
link-outline
After the help dialog closes the focus remains on the help link.

@drgrice1
Copy link
Owner

drgrice1 commented Aug 7, 2023

Also, one thing that you can do in the scss files is add a line like @debug lighten($link-hover-color, 30%). Then when you run the generate-assets.js script it will output the resulting value in the terminal.

@Alex-Jordan
Copy link
Author

Thanks, that will help. And I can see now just making these changes only apply to the nav links.

I think you maybe noted this, but with the green theme, the ratio between the non-active background and the active background is 8.63, less than 9. That makes it impossible to have an outline color that is at a ratio above 3 with each of them. So I may need to darken the green active background color.

@drgrice1
Copy link
Owner

drgrice1 commented Aug 7, 2023

Do you mean to darken the primary green? That should be fine.

@Alex-Jordan
Copy link
Author

Yes that's what I mean.

In the yellow theme, the contrast ratio between the active nav link (primary yellow) and non-active nav links (off white) is only 1.48. I'm not going to change anything about it, but thought I'd mention it. But unless you object, I would make the focus outline color have ratio at last 3 with each of those.

Perhaps (one day) we should offer each user the option to select a theme that works for them, with whatever accessibility concerns they have.

@drgrice1
Copy link
Owner

drgrice1 commented Aug 7, 2023

I was aware of the ratio for the primary color for the math4-yellow theme. If you can make the focus outline color have a ratio of 3 with both that should be good.

@drgrice1
Copy link
Owner

drgrice1 commented Aug 7, 2023

@Alex-Jordan: I rebased my branch that this is based on, and that caused conflicts. I wasn't thinking about this dependent pull request, and shouldn't have done that. In any case I fixed the conflicts. So you may need to pull to get those changes. Sorry.

@Alex-Jordan
Copy link
Author

OK, this is all updated.

  • 2px width for outline, and only within the site nav
  • almost all the contrast ratios for nav link background, nav link active background, and focus outline, are above 3:1. The one exception is with the yellow theme for nav link background with nav link active background.
  • cleand up hr css

Copy link
Owner

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now.

@drgrice1 drgrice1 merged commit bbd5261 into drgrice1:site-nav-link-colors Aug 8, 2023
drgrice1 added a commit that referenced this pull request Aug 8, 2023
@Alex-Jordan Alex-Jordan deleted the site-nav-link-colors branch August 18, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants